<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>caseListPage</title>
    {% load static %}
    <style>
    table{border-collapse:collapse;border-spacing:0;border-left:1px solid #888;border-top:1px solid #888;margin: auto}
    th,td{border-right:1px solid #888;border-bottom:1px solid #888;padding:5px 15px;}
    th{font-weight:bold;}
    body{text-align: center}
    </style>
    <script type='text/javascript' src="/static/js/jquery.min.js"></script>
    <script type="text/javascript" src="/static/js/jquery.tabslet.min.js"></script>
    <script type='text/javascript' src="/static/js/user.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $("a[name='gotoCaseDetailContentPage']").click(function(){
                $("input[name='projectId']").val($("#projectId").val());
                $("input[name='caseTitleId']").val($(this).parent().prev().find("input").val());
                $("input[name='caseDetailId']").val($(this).attr("id"));
                $("form[name='gotoCaseDetailContentPageForm']").submit();
            });

        })
    </script>
</head>
<body>
<div style="width: 80%;height:40px;background-color: aqua;margin: 0 auto ">
    <div style="float:left;margin-left: 10px;margin-right:10px;margin-top: 10px"><a href="#" name="projectAndMachinesRelationsPage">测试机列表</a></div>
    <div style="float:right;margin-right:10px;margin-top: 10px"><a href="#" name="logout">退出</a></div>
    <div style="float:right;margin-right:10px;margin-top: 10px">登录人：{{ request.session.showName }}&nbsp;&nbsp;</div>
    <form method="post" name="dataForm">
        {% csrf_token %}
        <input type="hidden" name="dataInput" />
    </form>
</div><p>
    <table>
        <tr>
            <td>测试项目</td>
            <td style="background-color: #009926">
                {{ project.projectName }}
                <input id="projectId" value="{{ project.id }}" type="hidden"/>
            </td>
            <td>阶段</td>
            <td style="background-color: #009926">
                {% if stage == '1' %}SIT{% else %}SVT{% endif %}
                <input type="hidden" name="stage" value="{{ stage }}">
            </td>
            <td>测试机</td>
            <td style="background-color: #009926">
                {{ noteBook.name }}
                <input type="hidden" name="machine" value="{{ noteBook.id }}">
            </td>
        </tr>
    </table>
    <p></p>
    <table>
        <tr>
            <td>序号</td>
            <td>测试case列表</td>
            <td>case目录</td>
        </tr>
        {% for caseAndCaseDetail in casesAndCaseDetailList %}
            <tr>
                <td>{{ forloop.counter }}</td>
                <td>
                    {{ caseAndCaseDetail.case.caseTitle }}
                    <input type="hidden" id="caseTitleId" value="{{ caseAndCaseDetail.case.id }}" />
                </td>
                <td style="text-align: left">
                    {% for caseDetail in caseAndCaseDetail.caseDetailList %}
                    <a href="#" name="gotoCaseDetailContentPage" id="{{ caseDetail.id }}">{{ caseDetail.caseDetailTitle }}</a>&nbsp;&nbsp;|
                    {% endfor %}
                </td>
            </tr>
        {% endfor %}
    </table>
    <form action="/gotoCaseDetailContentPage/" method="post" name="gotoCaseDetailContentPageForm">
        {% csrf_token %}
        <input type="hidden" name="projectId"/>
        <input type="hidden" name="caseTitleId"/>
        <input type="hidden" name="caseDetailId"/>
        <input type="hidden" name="stage" value="{{ stage }}"/>
        <input type="hidden" name="noteBook" value="{{ noteBook.id }}"/>
    </form>
</body>
</html>